package inutan.game.event.model;


import org.ricks.common.actor.Actors;
import org.ricks.common.event.IEvent;

/**
 * 登录事件
 */
public class LoginEvent implements IEvent {

    private long userId;

    public LoginEvent(long userId) {
        this.userId = userId;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    /**
     * 业务开发 用户事件线程分配例子
     *     @EventHandler(async = false)  事件线程默认是开启
     *     16 = Actors event-actor size
     * @return
     */
    @Override
    public long threadId() {
        return userId % Actors.me().getThreadNum();
    }
}
